package cate.common.table.d;

import cate.common.table.common.ParamSheet;
import cp.solution.util.str.Str;

import java.util.List;

public class GDFarm {
    public static int SEED_PLANT_MAX;
    private static String GROUND_OPEN_LEVEL_STR;
    private static String VIP_TREE_STR;
    public static String CD_MINUTE_CONSUME;
    private static final String VIP_GROUND_STR = "5#6";
    public static final int SEED_ITEM_EXCHANGE_SCALE = 10;
    public static double ACTIVITY_CD_SCALE;

    public enum VipType{
        /** 没有vip */
        NONE(0),
        /** 月卡 */
        MONTH(1),
        /** 永久 */
        FOREVER(2);
        public int payId;
        VipType(int payId) {
            this.payId = payId;
        }
        public static VipType getVipType(int payId) {
            for (VipType vipType : values()) {
                if (vipType.payId == payId) {
                    return vipType;
                }
            }
            return null;
        }
    }

    public static List<Byte> VIP_GROUNDS;
    public static List<Integer> VIP_TREES;
    public static List<Integer> GROUND_OPEN_LEVELS;

    public static void initialize(ParamSheet paramSheet) {
        SEED_PLANT_MAX = GDParamTool.getInt(paramSheet, 4502, 6);
        GROUND_OPEN_LEVEL_STR = GDParamTool.getString(paramSheet, 4505, "1#1#75#90#1#1");
        VIP_TREE_STR = GDParamTool.getString(paramSheet, 4506,  "7#8");
        CD_MINUTE_CONSUME = GDParamTool.getString(paramSheet, 4507, "0:2:1");
        VIP_TREES = Str.str2IntList(VIP_TREE_STR, "#");
        GROUND_OPEN_LEVELS = Str.str2IntList(GROUND_OPEN_LEVEL_STR, "#");
        VIP_GROUNDS = Str.str2ByteList(VIP_GROUND_STR, "#");
        ACTIVITY_CD_SCALE = GDParamTool.getDouble(paramSheet, 4509, 0.9);
    }
}
